/*AyflEomXWyqCHfdTxzWda3ExHehXzPX6thlzEnTk9yg=*/
import React, { Component } from 'react';
import { createPage, ajax, base, high, getMultiLang } from 'nc-lightapp-front';
import './index.less';
const { NCModal, NCButton, NCForm } = base;

 class PromptModel extends Component {
	constructor(props) {
		super(props);
		this.state = {
			json: {}
		};
	}

	componentWillMount() {
		let callback = (json) => {
			this.setState({ json: json });
		}
		getMultiLang({ moduleId: 'public', domainName: 'arap', currentLocale: 'simpchn', callback });
	}
	componentDidMount() { 
		this.props.onRef(this);
	}
	//取消按钮
	handleClose = () => {
		this.props.handleModel('n');
	};

	//取消
	handleCancel = () => {
		this.props.handleModel('n');
	};
	//确定按钮
	handleEnsure = () => {
		this.props.handleModel('y');
	};
	modalOpen = () => {
		this.props.modal.show('prompt');
	}
	modalClose = () => {
		this.props.modal.close('prompt');
	}
	render() {
		let { show, modal } = this.props;
		let { createModal } = modal;
		return (
			<div id="periodModelId" className="query-modal">
				{createModal('prompt', {
					title:
						<div className="modal-tit">
							<span className="modal-tit-name">{this.state.json['public-000078']}</span>{/* 国际化处理： 警告*/}
							<span onClick={this.handleClose.bind(this)} className="querymodal-tit-close">
								X
				   </span>
						</div>,
					content: this.props.tit,
					showCustomBtns: true,
					customBtns:
						<div>
							<NCButton fieldid="yes" style={{ marginRight: 20 }} type="primary" onClick={() => this.handleEnsure()}>
								{this.state.json['public-000079']}(Y){/* 国际化处理： 是*/}
							</NCButton>
							<NCButton fieldid="no" style={{ marginRight: 20 }} type="primary" onClick={() => this.handleCancel()}>
								{this.state.json['public-000080']}(N){/* 国际化处理： 否*/}
							</NCButton>
						</div>
				})}
			</div>
		);
	}
}
PromptModel = createPage({})(PromptModel);
	export default PromptModel;


/*AyflEomXWyqCHfdTxzWda3ExHehXzPX6thlzEnTk9yg=*/